<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body >
	<div id="example-1">
		<button-counter></button-counter>
		<button-counter></button-counter>
		<button-counter></button-counter>
		</br>
		<!--<blog-post title="My journey with Vue" id="1"></blog-post>
		<blog-post title="Blogging with Vue"></blog-post>
		<blog-post title="Why Vue is so fun"></blog-post>-->
		<blog-post v-for="post in posts" v-bind:key="post.id" v-bind:title="post.title" v-bind:id="post.id"></blog-post>
	</div>
	
		
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.9/vue.js"></script>
<script>
	Vue.component('button-counter', {
		data:function(){
			return {
				count:0,
			}
		},
		template:'<button v-on:click="count++">You clicked me {{count}}</button>',
	});
	Vue.component('blog-post',{
		data:function(){
			return {
			}
		},
		props:['title','id'],
		template:'<h3>{{title}} {{id}}</h3>',
	});
	var vm = new Vue({
		el:'#example-1',
		data:{
			posts:[
					{id:1,title:'My journey with Vue'},
					{id:2,title:'Blogging with Vue'},
					{id:3,title:'Why Vue is so fun'},
				]
		}
	});
	
</script>
</html>



















































